#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 crane <crane@his-pc>
#
# Distributed under terms of the MIT license.

"""

"""


class Solution:
    """
    @param chars: The integer array you should partition
    @param k: An integer
    @return: The index after partition
    """
    '''
    小写在前, 大写在后.
    '''
    def sortLetters(self, chars):
        # write your code here
        if not chars:
            return chars

        l = len(chars)

        # [start, end] is all close
        start, end = 0, l-1
        while start < end + 1:
            c = chars[start]
            if c.islower():
                start += 1
            else:
                chars[start], chars[end] = chars[end], chars[start]
                end -= 1
        return chars


def main():
    print("start main")

if __name__ == "__main__":
    main()
